import React from "react";
import { Route, HashRouter } from "dva/router";
import { ConnectedRouter } from "connected-react-router";
import List from "../component/List";
import Test from "../component/Test";
import store from "./store";
import history from "./history";
import { Provider } from "react-redux";
import H5Nav from "../lib/H5Nav";
import NavAdapter from "../lib/H5NavAdapter";

export default class App extends React.Component {
  constructor(props) {
    super(props);
    H5Nav.setAdapter(new NavAdapter(store));
  }

  render() {
    return (
      <Provider store={store}>
        <ConnectedRouter history={history}>
          <HashRouter>
            <div>
              <Route exact path="/" component={List} />
              <Route path="/test" component={Test}>
                <Route exact path="/list" component={List}></Route>
              </Route>
            </div>
          </HashRouter>
        </ConnectedRouter>
      </Provider>
    );
  }
}
